
package com.pantuo.sys.controller;


import com.pantuo.common.utils.TableRequest;
import com.pantuo.common.vo.JsonResult;
import com.pantuo.sys.service.StatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageImpl;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;

@RestController
public class StatisticsController {


    @Autowired
    private StatisticsService statisticsService;

    @RequestMapping("/statistics/doFindTotal")
    public JsonResult doFindTotal(String date_s) throws SQLException, ClassNotFoundException {
        statisticsService.findTotal(date_s);
        return new JsonResult("统计成功");
    }

    /***
    * @Description: 查询公司，线路，车辆，设备的信息
    * @Param: [request, className]
    * @return: com.pantuo.common.vo.JsonResult
    * @Author: 炳秦
    * @Date: 2021/11/8 10:04
    */
    @RequestMapping({"/sys/st/doFindAllFields"})
    public JsonResult doFindTotalByVeh(TableRequest request, String className) throws IOException {
        PageImpl<Object> pageObjects = this.statisticsService.findAllFields(request);
        return new JsonResult(pageObjects);
    }


}
